﻿<local:AboutPageBase
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
	xmlns:local="clr-namespace:Com.PhilChuang.Pmvp.Ui.Views.Impl.Pages"
	x:Class="Com.PhilChuang.Pmvp.Ui.Views.Impl.Pages.AboutPage"
	mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800" d:DataContext="{d:DesignData /SampleData/AboutPageViewModelSampleData.xaml}"
	FontFamily="{StaticResource PhoneFontFamilyNormal}"
	FontSize="{StaticResource PhoneFontSizeNormal}"
	Foreground="{StaticResource PhoneForegroundBrush}"
	Orientation="Portrait"
	SupportedOrientations="PortraitOrLandscape"
	shell:SystemTray.IsVisible="True" 
	IsEnabled="{Binding AllControlsEnabled}">

	<!--LayoutRoot is the root grid where all page content is placed-->
	<Grid x:Name="LayoutRoot" Background="Transparent">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>
		
		<!--TitlePanel contains the name of the application and page title-->
		<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,0,0,12">
			<TextBlock x:Name="ApplicationTitle" Margin="-12,0,0,0" Text="{Binding AppVersionString}" Style="{StaticResource PhoneTextNormalStyle}"/>
			<TextBlock x:Name="PageTitle" Text="About" Margin="12,-7,0,-7" Style="{StaticResource PhoneTextTitle1Style}"/>
		</StackPanel>
		
		<Grid x:Name="ContentPanel" Margin="12,0,12,0" Grid.Row="1">
			<controls:Pivot Margin="-12,-12,0,0" Title="">
				<controls:Pivot.HeaderTemplate>
					<DataTemplate>
						<TextBlock Text="{Binding}" Style="{StaticResource PhoneTextLargeStyle}" Margin="0,0,12,0" />
					</DataTemplate>
				</controls:Pivot.HeaderTemplate>
				
				<controls:PivotItem Header="info">
					<ScrollViewer>
						<StackPanel>
							<Grid Margin="0" VerticalAlignment="Bottom">
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
									<RowDefinition/>
								</Grid.RowDefinitions>
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="Auto"/>
									<ColumnDefinition/>
								</Grid.ColumnDefinitions>
								<TextBlock Style="{StaticResource PhoneTextNormalStyle}" Text="Name" />
								<TextBlock TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}" Text="{Binding VersionInfo.ProductName}" Grid.Column="1"/>
								<TextBlock Style="{StaticResource PhoneTextNormalStyle}" Text="Version" Grid.Row="1" />
								<TextBlock TextWrapping="Wrap" Grid.Column="1" Style="{StaticResource PhoneTextNormalStyle}" Text="{Binding VersionInfo.VersionString}" Grid.Row="1" />
								<TextBlock Style="{StaticResource PhoneTextNormalStyle}" Text="Date" Grid.Row="2" />
								<TextBlock TextWrapping="Wrap" Grid.Column="1" Style="{StaticResource PhoneTextNormalStyle}" Text="{Binding VersionInfoDate}" Grid.Row="2" />
							</Grid>
							<TextBlock TextWrapping="Wrap" Text="{Binding RateAppText}" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,30,12,0"/>
							<Button x:Name="g_btn_LaunchAppRateLink" Content="{Binding RateAppButtonText}" Click="g_btn_LaunchAppRateLink_Click" Margin="0"/>
							<TextBlock TextWrapping="Wrap" Text="{Binding SendFeedbackText}" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,30,12,0"/>
							<Button x:Name="g_btn_SendFeedback" Content="Send feedback" Click="g_btn_SendFeedback_Click" Margin="0"/>
							<Button x:Name="g_btn_LaunchAppWebsiteLink" Content="Launch the app website" Margin="0,30,0,0" Click="g_btn_LaunchAppWebsiteLink_Click"/>
						</StackPanel>
					</ScrollViewer>
				</controls:PivotItem>
				
				<controls:PivotItem Header="help">
					<Grid>
						<phone:WebBrowser x:Name="g_WebBrowser" Loaded="g_WebBrowser_Loaded" Navigating="g_WebBrowser_Navigating" IsScriptEnabled="True" />
					</Grid>
				</controls:PivotItem>
				
			</controls:Pivot>
		</Grid>

	</Grid>
</local:AboutPageBase>